using System.Collections.Generic;
using System.Linq;
using TickSharp.Core.Infrastructure.Repositories;
using TickSharp.Core.Model;
using Xunit;

namespace TickSharp.Tests.IntegrationTests.Infrastructure
{
    public class ProjectRepositoryTester : RepositoryTesterBase
    {
        [Fact]
        public void ListReturnsProjectsWithTasks()
        {
            ProjectRepository projectRepository = new ProjectRepository(GetApiConnectionInfo());
            IEnumerable<Project> projects = projectRepository.List();            

            Assert.Equal(2, projects.Single().Tasks.Count());
        }
    }
}